import Vue from 'vue'
import Router from 'vue-router'
import IndexPage from '../views/Index.vue'
import BzNaming from '../views/BzNaming.vue'
import BzResult from '../views/BzNamingResult.vue'
import WxLeida from '../componments/echart/wx_leida.vue'
import BzTest from '../views/BzTest.vue'
import BztestResult from '../views/BzTestResult.vue'
import store from '../store/index'
Vue.use(Router)

const router = new Router({
  routes: [{
      path: '/',
      component: IndexPage
    }, {
      path: '/bz_namimg',
      component: BzNaming
    },{
      path: '/bz_result',
      component: BzResult
    },
    {
      path: '/test',
      component: WxLeida
    },{
      path: '/bz_test',
      component: BzTest
    },{
      path: '/bztest_result',
      component: BztestResult
    }
  ]
})
router.beforeEach((to, from, next) => {
  if (to.path == '/') {
    store.state.show_back_btn = false
    next()
  } else {
    store.state.show_back_btn = true
    next()
  }

})
export default router
